<template>
  <div :style="{ height: height }" class="jyfw-con">
    <div :key="index" v-for="(item, index) in formList" style="position: relative">
      <a-form-model-item
        :label="index == 0 ? '主营经营范围' : '经营范围' + (index + 1)"
        required
        :validateStatus="hasError[index]['ids'] && (hasError[index]['ids'].show === true)?'error':'success'"
        :help="hasError[index]['ids'] && (hasError[index]['ids'].show === true)? hasError[index]['ids'].erroeMsg : ''"
      >
      <!-- :validateStatus="validateStatusList[index]"
        :help="validateStatusList[index] == 'error' ? '请选择经营范围' : ''" -->
        <!--        <span class="commonItem" slot="label">{{ index == 0 ? '主营业务经营类别' : '经营类别' + (index + 1) }}</span>-->
        <a-cascader
          :class="['jyfw-value-con', item.hasError ? 'jyfw-has-error' : ''].join(' ')"
          :options="index==0 ?masterDataSourceList : options"
          v-model="item.ids"
          :disabled="isReadonly"
          :field-names="{ label: 'nodeName', value: 'id', children: 'children' }"
          :show-search="{ filter }"
          placeholder="请选择经营范围"
          @change="
            (...args) => {
              onChange(index, ...args)
            }
          "
        />
      </a-form-model-item>

      <!-- 备注  -->
      <a-form-model-item label="   " class="not-label" v-if="item.nodeDescription">
        <!--        <Tips :tips="item.nodeDescription"></Tips>-->
        <a-alert :message="item.nodeDescription" type="info" show-icon class="ant-alert-error"/>
      </a-form-model-item>

      <a-form-model-item label="相关活动">
        <!--        <span class="commonItem" slot="label">经营活动</span>-->
        <a-textarea v-model="item.nodeActivty" disabled :rows="3" />
      </a-form-model-item>
      <!-- <a-form-model-item label="开票类目">
        <a-textarea v-model="item.invoiceName" disabled :rows="3" />
      </a-form-model-item> -->
      <a-form-model-item label="应税项目">
        <JYFWNewItem :dataArr="item.invoiceName"></JYFWNewItem>
      </a-form-model-item>

      <!-- 组织形式  -->
      <a-form-model-item v-if="index == 0" label="组织形式"  required
        :validateStatus="hasError[index]['organizationForm'] && (hasError[index]['organizationForm'].show === true)?'error':'success'"
        :help="hasError[index]['organizationForm'] && (hasError[index]['organizationForm'].show === true )? hasError[index]['organizationForm'].erroeMsg : ''"
      >
        <!-- :validateStatus="validateStatusList1.status" -->
        <!-- :help="validateStatusList1.msg" -->

        <!-- {{validateStatusList1}}
        {{validateStatusList1 == 'error' ? '请选择组织形式' : ''}} -->
        <!-- :disabled="isReadonly"  20231010 核名状态下放开组织形式选择 -->
        <a-select v-model="item.organizationForm"  placeholder="请选择组织形式" @change="
            (...args) => {
              onChange1(index, ...args)
            }
          " >
          <a-select-option :key="'a-select-option'+index" :value="item.value" v-for="(item,index) in selectOptionList">
            {{item.label}}
          </a-select-option>

        </a-select>
      </a-form-model-item>
      <a-button
        type="link"
        icon="minus"
        class="minus"
        style="color: #cc0000"
        v-if="index != 0"
        :disabled="isReadonly"
        @click="deleteRateFun(index)"
      >删除经营范围
      </a-button>
    </div>
    <div>
      <!-- <a-button type="primary" @click="checkRes"> 新增 </a-button> -->
    </div>

  </div>
</template>

<script>
import JYFWNewItem from './JYFWNewItem.vue'
import * as Util from '@/utils/util'

export default {
  // import引入的组件需要注入到对象中才能使用
  name: 'JYFWNew',
  components: {JYFWNewItem},
  props: {
    isReadonly: { type: Boolean, default: false },
    // 主数据源
    masterDataSource:{
      type: Array,
      required: true,
      default: [],
    },
    // 下来列表的option数据
    optionList: {
      type: Array,
      required: true,
      default: [],
    },
    // 默认值显示
    defaultValue: { type: Array },
    // [{ids:[], parentId, invoiceId, invoiceName, labelEntname, labelOrgname, nodeActivty, nodeName, nodeNature}]
    value: { type: Array },
    height: { type: Number, default: 420 },
  },
  data() {
    // 这里存放数据
    return {
      // dataArr:tempData,
      selectOptionList:[
        // {label:'组织形式1',value:'1'},
        // {label:'组织形式2',value:'2'},
        // {label:'组织形式3',value:'3'},
      ],
      formList: [],
      masterDataSourceList:[],
      // 主营经营范围
      masterDataSourceObj:{},
      optionOld: [],
      // 存放扁平化后的数据
      objOption: {},
      selectOptionItemArr: {},
      hasError: {},
      validateStatusList: {
        0: 'success',
      },
      validateStatusList1: {
        status:'',
        msg:''
      },
    }
  },
  // 监听属性 类似于data概念
  computed: {
    options() {
      return this.dataConversion(this.optionOld, this.objOption)
    },
  },
  // 监控data中的数据变化
  watch: {
    masterDataSource: {
      handler(val, oldVal) {

        this.setMasterDataSource(val)

        if (JSON.stringify(val) != JSON.stringify(oldVal)) {
          this.masterDataSourceObj = Util.dataFlattening(val)
          this.$nextTick(() => {
            this.setDefaultValue(this.defaultValue)
          })
          // console.log('@@@@@@@@@@@@@@@@@masterDataSource@@@@@@@@@@@@@@@@@@@@@@@@@@@@22',val,this.masterDataSourceObj,Util.dataFlattening(val));
        }
      },
      deep: true,
      // immediate: true
    },
    optionList: {
      handler(val, oldVal) {
        // console.log('监控optionList中的数据变化===========>', val)
        // this.$nextTick(() => {
        //   this.setOptionData(val)
        // })
        if (JSON.stringify(val) != JSON.stringify(oldVal)) {
          this.setOptionData(val)
        }
      },
      deep: true,
      // immediate: true
    },
    value: {
      handler(val) {
        // [{ids:[], parentId, invoiceId, invoiceName, labelEntname, labelOrgname, nodeActivty, nodeName, nodeNature}]
        // to
        // { ids: [], nodeName: '', nodeNature: '', invoiceName: '', optionList: this.options }
        // if(val && val.length>0){
        //   this.$nextTick(() => {
        //     const tempArr = []
        //     val.forEach((item, index) => {
        //       const { ids, nodeName, nodeNature, invoiceName } = item
        //       const tempItem = this.objOption[ids[ids.length - 1]]
        //       const tempObj = {...tempItem,ids,hasError: false,}
        //       tempArr.push(tempObj)
        //       this.updateselectOptionItemArr(index, ids)
        //     })
        //     this.formList = tempArr
        //     this.optionOld = [...this.optionOld]
        //     // this.updateChangeData()
        //   })
        // }
      },
      deep: true,
      immediate: true,
    },
    defaultValue: {
      handler(val) {
        // [{ids:[], parentId, invoiceId, invoiceName, labelEntname, labelOrgname, nodeActivty, nodeName, nodeNature}]
        // to
        // { ids: [], nodeName: '', nodeNature: '', invoiceName: '', optionList: this.options }

        this.$nextTick(() => {
          this.setDefaultValue(val)
          // if (this.isType.isArray(val) && val.length > 0) {
          //   val.forEach((item, index) => {
          //     const { ids,organizationForm } = item
          //     if (this.isType.isArray(ids) && ids.length > 0) {
          //       this.add(ids, index,organizationForm)
          //     }
          //   })
          // } else {
          //   this.formList = []
          //   this.add()
          // }
        })
      },
      deep: true,
      immediate: true,
    },
    formList: {
      handler(val) {
        this.$nextTick(() => {
          // console.log('formList====>', val)
          // const tempArr = []
          // val.forEach((item, index) => {
          //   // item.optionList = this.options
          //   // console.log('=========11===========>', item,item.ids)
          //   // const tempItem = {...item}
          //   if (item.ids.length > 0) {
          //     this.hasError[index] = { erroeMsg: '请选择经营类别', show: false }
          //     item.hasError = false
          //   } else {
          //     this.hasError[index] = { erroeMsg: '请选择经营类别', show: true }
          //     item.hasError = true
          //   }
          //   // tempArr.push(tempItem)
          // })
          // this.formList = tempArr
          // val.forEach((item, index) => {
          //   if (item.id) {
          //     this.validateStatusList[index] && (this.validateStatusList[index] = 'success')
          //   } else {
          //     this.validateStatusList[index] && (this.validateStatusList[index] = 'error')
          //   }
          // })
          // this.getHasError(val)
        })
      },
      deep: true,
      // immediate: true,
    },
  },
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    this.init()
  },
  // 方法集合
  methods: {
    setMasterDataSource(dataList){
      if(this.isType.isNullOrUnDef(dataList) || this.isType.isEmpty(dataList)){
        return false
      }
      // 判断是否可用 disabled  0-待审核;1-生效;2-驳回;3-停用;4-待审核(停用);5-待审核(启用);6-待生效;7-待停用;
      const getStatus=(status)=>{
        let tempDisabled = false // 默认值 false 启用
        const wList = [0,2,3,6,5] // 禁用名单
        if(wList.indexOf(status)>=0){
          tempDisabled = true
        }
        return tempDisabled
      }
      const mapList = (item)=>{
        const {children,status} = item
        const resObj = {...item,status,disabled: getStatus(status)}
        let tempchildren = []
        if(children && this.isType.isArray(children)){
          tempchildren = children.map(cItem=>{
            return mapList(cItem)
          })
        }
        if(tempchildren.length>0){
          resObj['children'] = tempchildren
        }
        return resObj
      }

      const tempArr = []
      dataList.forEach(item=>{
        tempArr.push(mapList(item))
      })
      this.masterDataSourceList = tempArr
    },
    setDefaultValue(val){
      // console.log('@@@@@@@@@@@@@@@@@setDefaultValue',val);
      if (this.isType.isArray(val) && val.length > 0) {
        val.forEach((item, index) => {
          const { ids,organizationForm } = item
          if (this.isType.isArray(ids) && ids.length > 0) {
            this.add(ids, index,organizationForm)
          }
        })
      } else {
        this.formList = []
        this.add()
      }
    },
    checkRes() {
      let res = true // 默认值为true  表示校验通过   false 为校验不通过
      Object.keys(this.hasError).forEach(key=>{
        if(!this.isType.isEmpty(this.hasError[key])){
          res = false
        }
      })
      return res
    },
    getHasError(val) {
      const checkFieldAction=[
        [(item)=>{  return !this.isType.isArray(item.ids) || item.ids.length <= 0 },()=>'请选择经营类别','ids'],
        [(item)=>{ return this.isType.isEmpty(item.organizationForm) }, ()=>'请选择组织形式','organizationForm']
      ]
      const temo = {}
      val.forEach((item, index) => {
        const temp = {}
        if(index==0){
          checkFieldAction.forEach((action,index_)=>{
            if(action[0](item)){
              temp[action[2]] = { erroeMsg: action[1](), show: true }
              item.hasError = false
            }
          })
          if(temp['ids']){
            temp['organizationForm'].erroeMsg = '请先选择主营经营范围'
          }
          if(!temp['ids'] && !this.objOption[item.ids[1]]){
            temp['ids'] = { erroeMsg: '当前值不存在或者被禁用,请重新选择！', show: true }
          }


          temo[index] = temp
        }else{
          const action = checkFieldAction[0]
          if(action[0](item)){
            temp[action[2]] = { erroeMsg: action[1](), show: true }
            item.hasError = false
          }
          temo[index] = temp
        }
      })
      // console.log('@@@@@@@@@@@测试@@@getHasError@@@@@@@@@@',temo);
      this.hasError = temo
    },
    /**
     * 外部可以调用此方法进行添加
     */
    add(itemids, index,organizationForm) {
      let tempItem = {
        ids: [],
        addressName: '',
        parentId: '',
        children: [],
        invoiceId: '',
        invoiceName: [],
        labelEntname: '',
        labelOrgname: '',
        nodeActivty: '',
        nodeDescription: '',  //备注
        nodeName: '',
        nodeNature: '',
        hasError: false,
        organizationForm:''
      }
      if (itemids && itemids.length > 0) {
        const tempItem_ = this.objOption[itemids[itemids.length - 1]]
        tempItem = { ...tempItem, ...tempItem_, ids: itemids,organizationForm }
      }
      // console.log('###############################',index,this.formList,itemids)
      if (itemids && this.formList.length > 0) {
        if (this.formList[index]) {
          this.formList[index].ids = itemids
          this.formList[index].organizationForm = organizationForm
          this.onChange(index,itemids,null,organizationForm)
          // console.log('00000000000000000000000000000000000===>',organizationForm,this.formList[index].organizationForm);
          this.$nextTick(()=>{
            this.formList[index].organizationForm = organizationForm
            // console.log('11111111111111111111111111111111111===>',organizationForm,this.formList[index]);
            this.updateChangeData()
          })
        } else {
          this.formList.push(tempItem)
        }
      } else {
        if (this.isType.isNullOrUnDef(index)) {
          this.formList.push(tempItem)
        }
        if (this.isType.isNullOrUnDef(index) && this.formList.length == 0) {
          this.formList.push(tempItem)
        }
      }
      const tempvalidateStatusList = {}
      this.formList.forEach((item, index) => {
        // if (item.id) {
        //   tempvalidateStatusList[index] = 'success'
        // } else {
        //   tempvalidateStatusList[index] = 'warning'
        // }
        tempvalidateStatusList[index] = 'success'
      })
      this.validateStatusList = tempvalidateStatusList
      if (!itemids) {
        this.hasError[this.formList.length - 1] = { erroeMsg: '请选择经营类别', show: true }
      }
      // if(index && index!=0){
      // }
      this.updateselectOptionItemArr(index, itemids)
      this.updateChangeData()
    },
    /**
     * 外部使用 用于判断是否通过校验
     * @returns {Boolean} false 表示未通过校验  true 表示通过校验
     */
    getVerificationRes() {
      let res = true
      Object.keys(this.hasError).forEach((key) => {
        const tempVal = this.hasError[key]
        if (tempVal.show === true) {
          res = false
        }
      })
      return res
    },
    //删除经营范围
    deleteRateFun(index) {
      // this.formList.splice(index, 1);
      const tempDataArr = []
      const tempvalidateStatusList = {}
      this.formList.forEach((item, index_) => {
        if (index !== index_) {
          tempDataArr.push(item)
        } else {
          const { ids, id } = item
          if (id) {
            const tempOldVal = ids ? ids[item.ids.length - 1] : id
            this.objOption[tempOldVal].disabled = false
          }
        }
      })

      tempDataArr.forEach((item, index) => {
        // if (item.id) {
        //   tempvalidateStatusList[index] = 'success'
        // } else {
        //   tempvalidateStatusList[index] = 'warning'
        // }
        tempvalidateStatusList[index] = 'success'
      })
      this.validateStatusList = tempvalidateStatusList
      this.formList = tempDataArr
      this.updateChangeData()
    },
    deleteEvent(item, index_) {
      const self = this
      const dataSize = this.formList.length
      this.$confirm({
        content: '确定要删除吗？',
        onOk() {
          return new Promise((resolve, reject) => {
            if (dataSize == 1) {
              self.$message.warning('已经是最后一条了，不能再删了！')
            }
            if (dataSize > 1) {
              const tempDataArr = []
              self.formList.forEach((item, index) => {
                if (index !== index_) {
                  tempDataArr.push(item)
                } else {
                  const tempOldVal = item.ids[item.ids.length - 1]
                  self.objOption[tempOldVal].disabled = false
                }
              })
              self.formList = tempDataArr

              const changeValues = []
              self.formList.forEach((item) => {
                const { ids } = item
                const tempItem = self.objOption[ids[ids.length - 1]]
                changeValues.push({ ids, ...tempItem })
              })
              // console.log('onChange ===>', value, selectedOptions,changeValues)
              self.$emit('change.value', changeValues)
              self.$emit('change', changeValues)
              self.$emit('input', changeValues)
            }
            return resolve()
          })
        },
        cancelText: '取消',
        onCancel() {},
      })
    },
    onChange(index, value, selectedOptions,organizationForm) {
      // console.log('onChange======>', index, value)
      // 获取主营 organizationalList 组织形式数据
      if(index==0){
        this.$nextTick(()=>{
          const tempData = this.masterDataSourceObj[value[1]]
          this.setSelectOptionList(value[1])
          this.setFormListAttr(index,tempData,organizationForm)
        })
        // // const tempArr = [] // selectOptionList
        // // const tempObj = {0:"工作室",1:"部",2:'中心'}
        // // tempData && tempData.organizationalList && tempData.organizationalList.forEach(element => {
        // //   tempArr.push({label:tempObj[element],value:element})
        // // });
        // // this.selectOptionList = tempArr

        // this.formList[index].nodeActivty = tempData.nodeActivty
        // this.formList[index].invoiceName = tempData.invoiceName
        // this.formList[index].nodeDescription = tempData.nodeDescription
        // this.formList[index].labelOrgnameList = tempData.labelOrgnameList

      }else{
        // const {nodeActivty,invoiceName,nodeDescription,labelOrgnameList} = this.objOption[value[1]]
        // this.formList[index].nodeActivty = nodeActivty
        // this.formList[index].invoiceName = invoiceName
        // this.formList[index].nodeDescription = nodeDescription
        // this.formList[index].labelOrgnameList = labelOrgnameList

        this.$nextTick(()=>{
          this.setFormListAttr(index,this.objOption[value[1]],organizationForm)
        })
      }


      // if(index != 0){
      //   this.updateselectOptionItemArr(index, value)
      // }
      this.updateselectOptionItemArr(index, value)
      this.updateChangeData()
    },
    onChange1(index, value, selectedOptions) {
      // this.validateStatusList1.status = 'success'
      // this.validateStatusList1.msg = '已选择完成'
      this.formList[0].organizationForm = value

      // if (this.formList[0].organizationForm.toString() ) {
      //   console.log('onChange1======>', index, value,this.validateStatusList1)
      //   // this.validateStatusList1[index] && (this.validateStatusList1[index] = 'success')
      //   this.validateStatusList1.status = 'success'
      //   this.validateStatusList1.msg = '已选择完成'
      // } else {
      //   // this.validateStatusList1[index] && (this.validateStatusList1[index] = 'error')
      //   // this.validateStatusList1 = 'error'
      //   this.validateStatusList1.status = 'error'
      //   this.validateStatusList1.msg = '请选择组织形式'
      // }
      // this.updateselectOptionItemArr(index, value)
      this.updateChangeData()
    },
    setFormListAttr(index,dataObj,organizationForm){
      // console.log('@@@@@@@@@@@@@@===>',index ,dataObj);
      if(!dataObj || this.isType.isEmpty(dataObj)){
        return false
      }
      const {nodeActivty,invoiceName,nodeDescription,labelOrgnameList} = dataObj //  this.objOption[value[1]]
      this.formList[index].nodeActivty = nodeActivty
      this.formList[index].invoiceName = invoiceName
      this.formList[index].nodeDescription = nodeDescription
      this.formList[index].labelOrgnameList = labelOrgnameList
      if(organizationForm){
        this.formList[index].organizationForm = organizationForm
      }
    },
    setSelectOptionList(value){
      const tempArr = [] // selectOptionList
      const tempObj = {0:"工作室",1:"部",2:'中心'}
      const tempData = this.masterDataSourceObj[value]
      tempData && tempData.organizationalList && tempData.organizationalList.forEach(element => {
        tempArr.push({label:tempObj[element],value:element})
      });
      this.selectOptionList = tempArr
    },
    updateselectOptionItemArr(index, value) {
      // console.log('*****************************', index, value, this.selectOptionItemArr, this.objOption)
      if(this.isType.isEmpty(this.objOption)){
        return false
      }

      if (value && value.length > 0) {
        const tempArr = value[value.length - 1]
        // console.log('=================>', tempArr, this.optionList, this.objOption, this.objOption[tempArr])
        // if(!this.objOption[tempArr]){
        //   this.$message.warning('当前选择的经营范围的值可能不存在或者被禁用,请重新选择！')
        // }
        if (!this.selectOptionItemArr[index]) {
          this.selectOptionItemArr[index] = { newVal: tempArr, oldVal: '' }
          this.objOption[tempArr] && (this.objOption[tempArr]['disabled'] = true)
        } else {
          const tempOldVal = this.selectOptionItemArr[index].newVal
          this.selectOptionItemArr[index] = { newVal: tempArr, oldVal: tempOldVal }

          this.objOption[tempOldVal] && (this.objOption[tempOldVal].disabled = false)
          this.objOption[tempArr] && ( this.objOption[tempArr].disabled = true)
        }
        const selectData = this.objOption[tempArr]
        this.formList[index] = { ...this.formList[index], ...selectData, ids: value }
        // this.formList[index]['disabled'] = selectData.disabled
        // this.formList[index]['ids'] = value
      } else {
        // console.log('清空===============', index,this.formList[index],this.objOption);
        const tempItem = this.formList[index]
        if (tempItem && tempItem.id) {
          this.objOption[tempItem.id].disabled = false
          delete this.selectOptionItemArr[index]
          this.formList[index] = {
            ids: [],
            id: '',
            addressName: '',
            parentId: '',
            children: [],
            invoiceId: '',
            invoiceName: [],
            labelEntname: '',
            labelOrgname: '',
            nodeActivty: '',
            nodeDescription: '',
            nodeName: '',
            nodeNature: '',
            hasError: false,
          }
        }
      }
    },
    updateChangeData() {
      const changeValues = []
      this.formList.forEach((item,index) => {
        const { ids, id, parentId,organizationForm } = item
        const tempIds = ids ? ids : [parentId + '', id + '']
        const tempItem =  index==0 ? this.masterDataSourceObj[tempIds[1]] : this.objOption[tempIds[1]]
        changeValues.push({ ids: tempIds, ...tempItem,organizationForm })
        // console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!',changeValues);
      })
      // nodeActivty  invoiceName  nodeDescription  labelOrgnameList   labelOrgname
      // this.formList = changeValues
      // console.log('onChange ===>', changeValues)
      this.$nextTick(()=>{
        this.getHasError(this.formList)
      })
      // console.log('222222222222222222222222222222',changeValues);
      this.$emit('change.value', changeValues)
      this.$emit('change', changeValues)
      this.$emit('input', changeValues)
    },
    filter(inputValue, path) {
      // console.log('filter====>', inputValue, path)
      return path.some((option) => option.nodeName.indexOf(inputValue) > -1)
    },
    setOptionData(dataArr = []) {
      this.optionOld = dataArr
      this.objOption = Util.dataFlattening(dataArr)
      this.$nextTick(() => {
        this.setDefaultValue(this.defaultValue)
      })
    },
    dataConversion(optionOld, objOption) {
      const tempData = [...optionOld]
      const traverseData = (data) => {
        data.forEach((item) => {
          const { id, children } = item
          const isDisabled = objOption[id]
          item['disabled'] = isDisabled.disabled
          if (children && children.length > 0) {
            traverseData(children)
          }
        })
      }
      traverseData(tempData)
      // console.log('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$', tempData)
      return tempData
    },
    init() {
      // if (this.defaultValue.length == 0) {
      //   this.add()
      // }
    },
  },
}
</script>
<style lang="less" scoped>
.jyfw-new-con {
  width: 100%;
  height: 420px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  overflow: auto;
  padding: 10px;
  .jyfw-item-con {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    // flex-direction: column;

    .jyfw-item-doby {
      flex: 1;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      flex-direction: column;
      .jyfw-row {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-bottom: 24px;
        .jyfw-cell {
          display: flex;
          justify-content: flex-start;
          align-items: center;
          &.jyfw-label {
            flex: 1;
            display: flex;
            justify-content: flex-start;
            align-items: flex-start;
            max-width: 150px;
          }
          &.jyfw-value {
            flex: 5;
            display: flex;
            justify-content: flex-start;
            align-items: flex-start;
            flex-direction: column;
            .ant-form-explain {
              color: #f5222d;
              clear: both;
              min-height: 22px;
              margin-top: -2px;
              font-size: 14px;
              line-height: 1.5;
              transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
            }
            .jyfw-value-con {
              &.jyfw-has-error {
                border: 1px solid #f5222d;
                .ant-input {
                  border: 1px solid #f5222d;
                }
                input {
                  border: 1px solid #f5222d;
                }
              }
            }
          }
        }
      }
    }
    .jyfw-item-action {
      width: 100px;
      height: 100%;
      padding: 0 10px;
      display: flex;
      justify-content: center;
      align-items: flex-start;
    }
  }
}

/deep/ .ant-alert-error  .ant-alert-message{
  color: #f5222d;
}
//.jyfw-has-error {
//  border: 1px solid #f5222d;
//  .ant-input {
//    border: 1px solid #f5222d;
//  }
//  input {
//    border: 1px solid #f5222d;
//  }
//  .ant-input:hover {
//    border-color: #f5222d;
//  }
//}
.ant-cascader-input:hover {
  border-color: #f5222d;
}
//.jyfw-has-error {
//  .ant-input:hover {
//    border-color: #f5222d;
//  }
//input:hover {
//  border-color: #f5222d;
//}
//}

/deep/.ant-form-item {
  margin-top: 20px;
}
.minus {
  position: absolute;
  top: 4px;
  right: -130px;
}

.commonItem {
  white-space: nowrap;
  margin-right: 10px;
}
</style>
<style lang="less">
.not-label{
  .ant-form-item-label{
    label::after{
      content: '';
    }
  }
}
.jyfw-con{
  .ant-alert-error {
    background-color: #fff1f0 !important;
    border: 1px solid #ffa39e !important;
  }
}
</style>
